package com.pet.user.feign;

import com.pet.model.article.pojos.ApAuthor;
import com.pet.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "pet-article",path = "/api/apAuthor/v1",contextId = "apAuthor")
public interface ApAuthorFeign {

    /**
     * 根据app用户ID查询自媒体账户是否存在
     */
    @GetMapping("findApAuthor/{id}")
    public ApAuthor findByUserId(@PathVariable("id") Integer id);

    @PostMapping("save")
    public ResponseResult save(@RequestBody ApAuthor apAuthor);

    /**
     * 根据自媒体ID查找文章作者
     */
    @GetMapping("/findByName/{name}")
    public ApAuthor findByName(@PathVariable("name") String name);

    /**
     * 根据id查找作者
     */
    @GetMapping("/one/{id}")
    public ApAuthor findOne(@PathVariable("id") Integer id);
}
